package com.ljq.ipi;

/**
 * Description:电器父类
 * Author:ljq
 * Date:2025-02-16
 * Time:23:30
 */
public class Appliance {
    // 品牌
    private String brand;
    // 型号
    private String model;
    // 颜色
    private String color;
    // 售价
    private double price;
    // 生产商
    private String manufacturer;


    // 构造方法


    public Appliance() {
    }

    public Appliance(String brand, String model, String color, double price, String manufacturer) {
        this.brand = brand;
        this.model = model;
        this.color = color;
        this.price = price;
        this.manufacturer = manufacturer;
    }

    // Getter 和 Setter 方法
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    // 重写toString方法，方便打印电器信息
    @Override
    public String toString() {
        return "Appliance{" +
                "brand='" + brand + '\'' +
                ", model='" + model + '\'' +
                ", color='" + color + '\'' +
                ", price=" + price +
                ", manufacturer='" + manufacturer + '\'' +
                '}';
    }
}
